package club.twelveblog.tblog.dao;

import club.twelveblog.tblog.entity.Comment;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface CommentDao extends CrudRepository<Comment,Long> {
    @Query(nativeQuery = true,value = "SELECT * FROM tb_comment c WHERE c.u_id=?1")
    List<Comment> findCommentsByUid(Long uid);
}
